package tothreedesignmodel.observer;

import java.util.ArrayList;
import java.util.List;

/**
 * @author lzhphantom
 * @description
 * @date 创建于 22:21 2020/8/1
 * @modified
 */
public abstract class AbstractSubject {
    protected List<Observer> observers = new ArrayList<>();

    public void add(Observer observer) {
        observers.add(observer);
    }

    public void remove(Observer observer) {
        observers.remove(observer);
    }

    /**
     * notify observer
     *
     * @return void
     * @description
     * @author lzhphantom
     * @date 22:24 2020/8/1
     */
    public abstract void notifyObserver();
}
